import request from '@/utils/request'

export function fetchDataExtractionTaskList(data) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/list',
    method: 'post',
    data
  })
}

export function getDataExtractionTask(id) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/detail/' + id,
    method: 'get'
  })
}

export function createDataExtractionTask(data) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/add',
    method: 'post',
    data
  })
}

export function updateDataExtractionTask(data) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/update',
    method: 'post',
    data
  })
}

export function deleteDataExtractionTask(ids) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/delete',
    method: 'post',
    data: { ids }
  })
}
//开始停止
export function changeJobStatus(data) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/changeJobStatus' ,
    method: 'post',
    data
  })
}
//执行一次
export function startOne(data) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/runAJobNow' ,
    method: 'post',
    data
  })
}
export function startOneForSpark(data) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/runAJobNow' ,
    method: 'post',
    data
  })
}
export function getmetadataJob(id) {
  return request({
    url: '/system/dataextraction/DataExtractionTask/detail/' + id,
    method: 'get'
  })
}


